package com.xja.dubbo.util;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118643829";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCwQ6K3gDqoP5QlG/N82bQWamrfYyYtSjTSkdXmnAEz9SASuMo9FrRvKUU4kRCfSTqzgFAZDUcy4fYmiFy5VCksteH7XL9heHymS0pyiS7FZPAOd/BN3oaT/4ZnLZHgZxJ5p7cj7wvraKe1JUjrTEuIF97/sot4Pm/+1ssnJrXkboe/YIDg+hqkK0hq6rPz6+trKkBlgpwA6iTvoGHzZLbuarG7C3eTb/CqEkSxBJ6Al1Aw1KSS8AHDZaORj+cjnEL9izKX6cx5FUYtwmT15uELOrKjBkWCGEQfUur1ptabAYKiDLWdWUpiR+BHHNKhXwNWWKfkFCICO/M0iTeBlSPLAgMBAAECggEBAJEAQuaD9T0deGiCsu49RZm/F4YHUYumZQfocreQFKlCeI0OOUjB2dMsd0ZOiAcRPdoWr028j5q7KjyOpwDKzEh8o5edt86eSKSggXDxi2lVXOn6HtRgQAOWDGHqqfuZrygnIVDNQNf6syQgtPjkPaqKQKfGoFddvdI9rsfZX363VHVDTqVwQUHbpe4sgOMmNnOGlbzXtn9AtrH8y9ufGJwk/9pdAZSx3ydDCvAwbeTwL9k3PeNEEucsdicJHegMISZqgS7bN0vjowwpRNpCbV1oWeXxe54f9JU2jpG96HGBnFSzNzhnbn9r8Wu+iSvceSI9+Iy4Sa71IYQvyRHPlzkCgYEA4rg02cbSv//7xUJk6Fn8uH/NyJU82BUlW58b0BwyfJoOCKLmKkMW/DJuYC42kIIDDaSIp3koXTZi327b5/Kyn+9gOw0K+sKVwUptpnbWp1U6ORhrsMDymbHnhg6kuqbw71iOMP+L3/9y8KbdDA16FKqN/txLy9FUJl30qMDtkOUCgYEAxwdGrlcE4dd810RzW2YCnykCZ28whPeLMEtW+yrc8hYcxpNKiM7QYLEpSciV4+rOc9bTv9qB+nPp8KUFe/fvwH4mmbBVUvV2TEr7bnvDDTbtQHgXwWfMdr7BCEw/FRhAgaGPXZ6jyDqtYy8uPrqm/ovZRaXmZs3zK5h4THn3hu8CgYAL/mi1WKJPi/A6yD9kV1ZaQFCXmuWEHOJEDY/AG63ED7ZMWKnKdJAjuVtDdU5nqKkWsKyWB3/OJpFmdovlol42vcged5ssFt0rQ4+3bbP/WC/jU1pnGF39KX8xBVdLlIdMcifbiblRmUbwWjN5bsEVlMw8PlU4LBPCj9fgkYw/zQKBgFwIaE273X0VaRweAf3UqQeyLfNofhYuZcWaQQl545tqUDoe6AtlHwRnR8FfqLgw3vC/+UCxKQOIUDhABs4xc0Me0nilCn+HFAHpdmS7hBF7QbBbGBkOB4UtZhORNmZpxYJsE+BluDShtYW0znyhURFJ19mWAnmtaHHTWmV6zNQvAoGAFORJkweGKwgMozLxsAK5bFOsgP3EQN63BIzz/HLbsFgwTl4SwPDyCZsiIwFuOTk2kTSg4mNxv0JRz1svzXPr9+uTE5aTqDej+Yojl7Wk+kJhCYTex0lxGaOhRlZouUpxq6xo/G6ZONwaTKbBW2RsETBDjnUfC3U//C2RWzGsi7k=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnuTpXvi0AMUzGMyf8rLWJTebuAamCaBHS4bXakfRsYlpBxA59tuk75MDFlu+xq6xsyL3FS5T+f03HuFaRSwZTAEXkIO9fLb43djfi/3hn8G//rp9YFiaT1O9oYCKe/RrF6ISRd8IF8uB2yhJWdEp4JXKjAi8xfsvUtDZwQYgicxN0jQZpLkoPUyPgoYhEcDNx9YlqWVeQU3cTldKw9183IW9A2W+SCaWJ3SRhTTpeXoNjjlxSVvYtDbQ/3ZvZXVbzqac+zoRvyR/o2P92u4rrXTrj0K+F4PAm+lIdtjxjzD72AX7GdPl0eJryd/ab0CPn6NnS5nZY4EMXm+bpy9pGQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://localhost:8092/notify_url.jsp";
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8092/return";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


